<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>
	批量导入用户
</title>
<link href="./styles/layout.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" media="all"
	href="<c:url value='/styles/css.css'/>" />	 	
<script src="<c:url value='/scripts/common.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/form.js'/>"></script>
<script src="<c:url value="/scripts/datetime.js"/>" language="javascript"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>

<script type="text/javascript">
var success = '<c:out value="${flag}"/>'; 
if("success" == success) {
	alert("批量导入用户成功!");
	window.close();
	
	var url = window.opener.location;
	window.opener.location.href = url;
}else if("failure" == success){
	alert("批量导入用户失败!");	
}

function toSave(){ 
	if("" ==  document.forms[0].importName.value){
	 	alert("请选择文件导入!");
	 	return ;
	} 
	try{
		document.forms[0].submit();
	}catch(e){
		if(e.name=="TypeError") alert("文件格式不正确!");
	}	

}

function toUpload(){
	try{
		document.form1.action='<c:url value="/filterword.html?method=upload"/>';
		document.form1.submit();
	}catch(e){
		alert("文件路径不合法");
	}

}

function toReset(){
	document.forms[0].reset();
}

function toDownload(){
	window.open("./templates/userInfo.csv","_blank"); 
	 
}

function reloadOpener(){
	var flag = '<c:out value="${reloadFlag}"/>';
	if(flag=='ok'){
		var url = window.opener.location;
		window.opener.location.href = url;
	}
}

</script>

</head>

<body onload="reloadOpener();">

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
     <td class="home-content-title" ><img src="images/passenger.gif" width="21" height="22" align="absmiddle"/>批量导入用户 
	  </td>
  </tr>

  <tr>
    <td valign="top"> 
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td class="home-table-topline"> </td>
        </tr>
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-tool-content">
				<input  type="button"  class="home-inputBtn" value="导入"   onclick="toSave();"/>
                <input  type="button"  class="home-inputBtn" value="下载"   onclick="toDownload();" />
                <input  type="reset"   class="home-inputBtn" value="重置"   onclick="toReset();" />
                 </td>
              </tr>
              <tr>
                <td align="center" valign="top">&nbsp;</td>
              </tr>
              <tr> 
                <td valign="top" class="home-edittable-space"> <html:form action="/import.html?action=import" styleId="userInfoBean">		 
    	<table width="100%" border="1" cellspacing="1" cellpadding="1" style="border-collapse:collapse"> 
          
          <tr>
			<td align=right  width="15%" class="listtablebg" nowrap>文件选择：</td>
            <td align="left" colspan="3">
              	<html:file property="importName"   style="width: 205px"/>(支持"csv"格式)
            </td>
          </tr>
          
          <tr>
			<td align=left class="listtablebg" nowrap colspan="4">
				<font color="blue">
				说明：<br>
				csv导入的字段顺序是：用户帐号，密码，<br>
				中文名（姓名），部门代号，email，手机号码<br></font>
				<font color="red">注：手机号码和部门代号(存在于部门信息中)，<br>
				email输入要正确，否则会把该记录过滤掉的。</font>
				
			</td>
          </tr>    
        </table>
		</html:form>
                  
                </td>
              </tr>
            </table>
		  </td>
        </tr>
        <tr> 
          <td height="12">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table>
	  
	  </td>
  </tr>
  <tr>
    <td height="10">&nbsp;</td>
  </tr>
</table>


</body>
</html>